package com.samehope.ar.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: ZhangLuo
 * @Email: 1946430@qq.com
 */
@RestController
public class TestController {

    @PreAuthorize("hasAnyAuthority('ROLE_ADMIN, ROLE_COMPANY')")
    @GetMapping("/index")
    public String index() {
        return "ok";
    }

    @PreAuthorize("hasAnyAuthority('ROLE_COMPANY')")
    @GetMapping("/company")
    public String company() {
        return "ok";
    }

    @PreAuthorize("hasAnyAuthority('ROLE_ADMIN')")
    @GetMapping("/team")
    public String team() {
        return "ok";
    }
}
